package com.zookeeper.curator;

import com.zookeeper.utils.ConnectionUtil;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.barriers.DistributedBarrier;

/**
 * @Author 咕唧
 * @Date 2022/7/2 20:51
 * @Version 1.0
 */
public class CaiPan {
    public static void main(String[] args) throws Exception {
        //每个都单独创建一个客户端
        CuratorFramework framework = ConnectionUtil.getFramework();
        //这是另外一个客户端，想要控制barrier2，必须要保证路径参数相同
        DistributedBarrier distributedBarrier=new DistributedBarrier(framework, "/pd");
        //裁判开枪
        distributedBarrier.removeBarrier();
        System.out.println("放行，开始跑步");
    }
}
